<extend name="Public/base"/>

<block name="body">
    <!-- 标题栏 -->
    <div class="main-title">
        <h2>{$title}</h2>
    </div>
    <p class="check-tips" style="color: red">注：每次计算会展示选中的所有产品。</p>
    <!-- 隐藏域 -->
    <div hidden="hidden">
        <span id="func_id">{$id}</span>
    </div>
    <form action="" id="form" method="post" enctype="multipart/form-data" class="form-horizontal">
        <!-- 按钮工具栏 -->
        <div class="cf">
            <button class="btn fr fh_dis" onclick="javascript:history.back(-1);return false;" style="margin: 0px;background-color: #CACACA;">返 回</button>
            <div class="btn fr fh_dis"  onclick="submit()" style="margin-right: 5px">提 交</div>
        </div>
        <!-- 数据列表 -->
        <div class="data">
            <table class="">
                <thead>
                <tr>
                    <th class="public_tanle_qianmian"></th>
                    <th class="public_tanle_qianmian">产品图片</th>
                    <th class="public_tanle_qianmian">产品名称</th>
                    <th class="public_tanle_qianmian">标签</th>
                </tr>
                </thead>
                <tbody>
                <notempty name="arr">
                    <volist name="arr" id="arr_vo">
                        <tr>
                            <if condition='$arr_vo.checked eq 1'>
                                <td class="public_content_qianmian"><input checked type="checkbox" value="{$arr_vo.id}" style="margin: 0 auto"></td>
                            <else />
                                <td class="public_content_qianmian"><input type="checkbox" value="{$arr_vo.id}" style="margin: 0 auto"></td>
                            </if>
                            <td class="public_content_qianmian" width="120px"><img src="{$arr_vo.product_url}" style="height: auto;" /></td>
                            <td class="public_content_qianmian">{$arr_vo.product_name|default='--'}</td>
                            <td class="public_content_qianmian" width="180px">{$arr_vo.label|default='--'}</td>
                        </tr>
                    </volist>
                    <else/>
                    <td colspan="100" class="text-center"> 暂时没有内容 </td>
                </notempty>
                </tbody>
            </table>
        </div>
    </form>
</block>

<block name="script">
    <link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
    <php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
    <link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
    <!-- 引入CSS、JS开始 -->
    <link href="__CSS__/wash_helper/gm_table_public.css" rel="stylesheet" type="text/css">
    <!-- 引入CSS、JS结束 -->
    <script type="text/javascript">
        /* 当前子菜单栏高亮 */
        highlight_subnav('{:U('Calculation/func_menu')}');

        function submit() {
            var func_id = $("#func_id").html();
            var order = $("#order").html();
            var arr = [];
            $.each($('input:checkbox'),function(){
                if(this.checked){
                    arr.push($(this).val())
                }
            });

            var data = {
                id:func_id,
                product:arr
            };

            $.post("{:U('Calculation/three_func_wash_edit')}",data,function(result){
                var url = "/wash_helper/index.php?s=/Admin/Calculation/two_func_wash_choice/id/"+func_id;
                $(window.location).attr('href', url);
            });
        }
    </script>
</block>